package stage1.module3.homework3;

import java.util.Arrays;
import java.util.HashMap;

public class Homework3 {
    public static void main(String[] args) {
        String s = "123,456,789,123,456";
        HashMap<String, Integer> h = new HashMap<>();
        String[] sArr = s.split("\\W");
        for(String str : sArr){
            h.merge(str, 1, (oldVal, newVal) -> oldVal + newVal);
        }
        System.out.println(h);
    }
}
